package com.example.controller.flowable;

import com.example.service.flowable.IGeneralFlowableService;
import com.example.vo.ResultVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 通用的flowable工作流任务控制类
 * @author wsl
 */
@RequestMapping("/flowable/general")
@Api(tags = "工作流任务管理")
@RestController
public class GeneralFlowableTask {

    @Autowired
    private IGeneralFlowableService generalFlowableService;

    @GetMapping("/my-tasks")
    @ApiOperation(value = "查询我的任务")
    public ResultVo getMyTasks(@RequestParam("userId")String userId){
        return generalFlowableService.getMyTasks(userId);
    }

    @GetMapping("/my-start")
    @ApiOperation(value = "查询我发起的流程")
    public ResultVo getMyStart(@RequestParam("userId")String userId){
        return generalFlowableService.getMyStart(userId);
    }
}
